CC:=gcc

CFLAGS += -Wall -Wextra

CFLAGS += -I.
CFLAGS += -Ithirdparty
CFLAGS += -Iapp

LDLIBS += -lpaho-mqtt3c

SRC += $(shell find app -name "*.c"	-type f)
SRC += $(shell find thirdparty -name "*.c"	-type f)

OBJ := $(SRC:.c=.o)

%.o: %.c
	@-$(CC) $(CFLAGS) -c $^ -o $@

%_test: test/%_test.o $(OBJ)
	@-$(CC) $(CFLAGS) $^ -o $@ $(LDLIBS)
	@-./$@
	@-rm $@ $^

# gcc -Ixxx   为gcc指定include目录